<?php

session_start();

//include 'class/class.configuration.php';
define('CONF_PATH',     PATH.'conf/');
define('IMAGE_PATH',     PATH.'images/');
define('LIB_PATH',      PATH.'lib/');
define('SQL_PATH',      PATH.'sql/');
define('CLASS_PATH',    LIB_PATH.'class/');
define('INC_PATH',      LIB_PATH.'inc/');
define('PRIVATE_PATH',  LIB_PATH.'private/');
define('PUBLIC_PATH',   LIB_PATH.'public/');
define('UPLOAD_PATH',	PATH.'webroot/upload/');


$d = dir(INC_PATH);
while (false !== ($entry = $d->read())) {
    if (is_file(INC_PATH.$entry)) include INC_PATH.$entry;
}
$d->close();

$CONFIG = Array();
$CONFIG['DATABASE']  = Configuration::getByPath(CONF_PATH.'database.ini');
$CONFIG['GENERAL']   = Configuration::getByPath(CONF_PATH.'general.ini');
$CONFIG['SEO']       = Configuration::getByPath(CONF_PATH.'seo.ini');

defineif('DB_HOST',   $CONFIG['DATABASE']->MYSQL['db_host']);
defineif('DB_NAME',   $CONFIG['DATABASE']->MYSQL['db_name']);
defineif('DB_USER',   $CONFIG['DATABASE']->MYSQL['db_user']);
defineif('DB_PASS',   $CONFIG['DATABASE']->MYSQL['db_pass']);

try {
    $PDO = new PDO('mysql:host='.DB_HOST.';dbname='.DB_NAME, // Data Source Name
                    DB_USER,                                 // Username
                    DB_PASS);                                // Password
    $PDO->exec('SET NAMES utf8;');
} catch (PDOException $e) {
	echo "PDO Error : ".$e;
}

$page = Array('title'       => $CONFIG['GENERAL']->SITE['name'],
              'first-title' => $CONFIG['GENERAL']->SITE['name'],
              'sub-title'   => $CONFIG['GENERAL']->SITE['slogan'],
              'url'         => $CONFIG['GENERAL']->SITE['url'],
              'meta'        => Array('keywords'    => null,
                                     'description' => null));

?>